// ============================================================================
//
// Copyright (C) 2006-2007 Dengues
//
// Google Group: http://groups.google.com/group/dengues
// QQ Group: 24885404
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// ============================================================================
package org.dengues.core;

import java.sql.Connection;
import java.util.Map;
import java.util.Properties;

import org.dengues.core.codegen.ICodeGenerator;
import org.dengues.core.components.IComponentFilesNaming;
import org.dengues.core.components.IComponentsFactory;
import org.dengues.core.components.IXMLComponent;
import org.dengues.core.metadata.DatabaseContainer;
import org.dengues.core.process.ICompProcess;
import org.dengues.core.runprocess.IJavaETLProcessor;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.jface.action.Action;
import org.eclipse.swt.widgets.Shell;

/**
 * Qiang.Zhang.Adolf@gmail.com class global comment. Detailled comment <br/>
 * 
 * $Id: Dengues.epf 1 2006-09-29 17:06:40Z qiang.zhang $
 * 
 */
public interface IDesignerCoreService extends IDenguesService {

    /**
     * Qiang.Zhang.Adolf@gmail.com Comment method "getComponentsFactory".
     * 
     * @return
     */
    public IComponentsFactory getComponentsFactory();

    /**
     * Qiang.Zhang.Adolf@gmail.com Comment method "getComponentFilesNaming".
     * 
     * @return
     */
    public IComponentFilesNaming getComponentFilesNaming();

    /**
     * Qiang.Zhang.Adolf@gmail.com Comment method "initializeTemplates".
     */
    public void initializeTemplates();

    /**
     * Qiang.Zhang.Adolf@gmail.com Comment method "getCodeGenerator".
     * 
     * @return
     */
    public ICodeGenerator getCodeGenerator();

    /**
     * Qiang.Zhang.Adolf@gmail.com Comment method "getJavaProcessor".
     * 
     * @param process
     * @param path
     * @return
     */
    public IJavaETLProcessor getJavaProcessor(ICompProcess process, IPath path);

    /**
     * Qiang.Zhang.Adolf@gmail.com Comment method "getJavaProcessor".
     * 
     * @return
     */
    public IJavaETLProcessor getJavaProcessor();

    // public Action createStartHsqldbServer(String dbName);

    /**
     * Qiang.Zhang.Adolf@gmail.com Comment method "createStartHsqldbServer".
     * 
     * @return
     */
    public Action createStartHsqldbServer();

    /**
     * Qiang.Zhang.Adolf@gmail.com Comment method "checkHsqldbConnection".
     * 
     * @return
     */
    public boolean checkHsqldbConnection();

    /**
     * Qiang.Zhang.Adolf@gmail.com Comment method "runSqlScript".
     * 
     * @param scriptFile
     * @return
     */
    public ILaunch runSqlScript(IFile scriptFile, Map properties);

    /**
     * Qiang.Zhang.Adolf@gmail.com Comment method "getHsqlDatabase".
     * 
     * @return
     * @throws SQLException
     */
    // public DatabaseContainer getHsqlDatabase() throws SQLException;
    /**
     * Qiang.Zhang.Adolf@gmail.com Comment method "getCurrentConnection".
     * 
     * @return
     * @throws SQLException
     * @throws CoreException
     * @throws ClassNotFoundException
     */
    // public Connection getCurrentConnection() throws SQLException, CoreException, ClassNotFoundException;
    /**
     * Qiang.Zhang.Adolf@gmail.com Comment method "launchShadowProcess".
     * 
     * @param component
     * @param properties
     * @return
     * @throws Exception
     */
    public Process launchShadowProcess(IXMLComponent component, Properties properties) throws Exception;

    /**
     * Qiang.Zhang.Adolf@gmail.com Comment method "getDatabaseContainerFrommConnection".
     * 
     * @param connection
     * @param baseProperties
     * @return
     */
    public DatabaseContainer getDatabaseContainerFrommConnection(Connection connection, Map baseProperties);

    /**
     * Qiang.Zhang.Adolf@gmail.com Comment method "initJavaProject".
     */
    public void initJavaProject();

    /**
     * Qiang.Zhang.Adolf@gmail.com Comment method "importDemoProject".
     * 
     * @param shell
     * @param monitor
     */
    public void importDemoProject(Shell shell, IProgressMonitor monitor);
}
